package xidian.vlab.domin.User;

import xidian.vlab.domin.Record;
import xidian.vlab.domin.Room;

import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;

@Entity
public class Teacher {
    @Id
    private Long tid;
    private String name;
    private String password;
    private String email;
    private String projectID;
    private String userID;

    @OneToMany(mappedBy = "teacher", cascade = CascadeType.ALL)
    private List<Room> rooms = new ArrayList<>();
    @OneToMany(mappedBy = "teacher", cascade = CascadeType.ALL)
    private List<Record> records = new ArrayList<>();

    //////////////////////////////////////////////////////

    public Long getTid() {
        return tid;
    }

    public void setTid(Long tid) {
        this.tid = tid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getProjectID() {
        return projectID;
    }

    public void setProjectID(String projectID) {
        this.projectID = projectID;
    }

    public String getUserID() {
        return userID;
    }

    public void setUserID(String userID) {
        this.userID = userID;
    }

    public List<Room> getRooms() {
        return rooms;
    }

    public void setRooms(List<Room> rooms) {
        this.rooms = rooms;
    }

    public List<Record> getRecords() {
        return records;
    }

    public void setRecords(List<Record> records) {
        this.records = records;
    }

    @Override
    public String toString() {
        return "Teacher{" +
                "tid=" + tid +
                ", name='" + name + '\'' +
                ", password='" + password + '\'' +
                ", email='" + email + '\'' +
                ", rooms=" + rooms +
                '}';
    }
}
